<HTML>
<HEAD>
<TITLE>DefaultProjectName - CMessageBoxWindow</TITLE>
<script type="text/javascript">
  var relPathToCommmon = "../../common/";
  var relPathToHelpDir = "../../common/help/";
</script>
<script type="text/javascript" src="../../common/jsdyn.js" language="JavaScript"></script>
<script type="text/javascript" src="../../common/js.js" language="JavaScript"></script>
<script type="text/javascript" src="leftmenu.js" language="JavaScript"></script>
<script type="text/javascript">
  var toSearchPage     = "_search','../../search";
  Body1();
</script>
<div class="headerPage">CMessageBoxWindow</div>
<div class="path"><a href="#" OnMouseOver="link('','../../index',this)" class="pathLink">OOXlib</A><img src="../../common/path-arrow.gif" class="path-arrow"><a href="#" OnMouseOver="link('_dir','include0',this)" class="pathLink">include</A><img src="../../common/path-arrow.gif" class="path-arrow"><a href="#" OnMouseOver="link('_class','CMessageBoxWindow4032',this)" class="pathLink">CMessageBoxWindow</A><img src="../../common/path-arrow.gif" class="path-arrow"><span class="pathNonLink">CMessageBoxWindow</span></div>
<script type="text/javascript">
 Body2();
 BodyLeftMenuStart();
WriteLeftMenu("","","","");
 BodyLeftMenuEnd();
 Body3();
</script>
<span class="tabInActive"><a href="#" OnMouseOver="linkTab('_member','CMessageBoxWindow4086862626','_description',this)" class="tabLinkInActive">Description</a></span>
<span class="tabActive"><a href="#" OnMouseOver="linkTab('_member','CMessageBoxWindow4086862626','_source',this)" class="tabLinkActive">Source</a></span>
<span class="tabInActive"><a href="#" OnMouseOver="linkTab('_member','CMessageBoxWindow4086862626','_callgraph',this)" class="tabLinkInActive">Call Graph</a></span>
<script type="text/javascript">
 Body4();
</script>
<div class="contentAirTop"></div>
<div class="paragraph2NoTopPadding">Start Line: 62</div>
<pre class="codeExamples">
<a href="#" onMouseOver="link('_member','CMessageBoxWindow4086862626',this); overLibDiagram();return overlib('<strong>Syntax</strong><BR>CMessageBoxWindow<BR>(const CXServerConnection * pXServerConnection, const CScreen * pScreen, const CUInt2dRectangle & Rectangle, const IEventHandler * pEventHandler, const ::std::string & WindowName, const ::std::string & MessageText, const ::std::string & IconPath, const ::std::string & ImagePath, const CColor * pBackgroundColor, const CColor * pTextColor, const unsigned int iHorizontalOffset, const unsigned int iVerticalOffset)',CAPTION,'<strong>Brief description</strong><BR>Constructor.');" onMouseOut="return nd();">OOXlib::CMessageBoxWindow::CMessageBoxWindow</a>(const CXServerConnection *pXServerConnection, const CScreen *pScreen, const CUInt2dRectangle &amp;Rectangle, const IEventHandler *pEventHandler, const::std::string &amp;WindowName, const::std::string &amp;MessageText, const::std::string &amp;IconPath, const::std::string &amp;ImagePath, const CColor *pBackgroundColor, const CColor *pTextColor, const unsigned int iHorizontalOffset, const unsigned int iVerticalOffset)
   : <a href="#" onMouseOver="link('_member','CSimpleWindow1572908937',this); overLibDiagram();return overlib('<strong>Syntax</strong><BR>CSimpleWindow&nbsp;&nbsp;(const CXServerConnection * pXServerConnection, const CScreen * pScreen)',CAPTION,'<strong>Brief description</strong><BR>Constructor.');" onMouseOut="return nd();">CSimpleWindow</a>(pXServerConnection, pScreen, NULL, Rectangle, NoEventMask, NULL, WindowName, "MessageBox", IconPath, pBackgroundColor, 0, false, true),
   <a href="#" onMouseOver="link('_member','m_pGC3523944850',this); overLibDiagram();return overlib('<strong>Syntax</strong><BR>CGraphicsContext *&nbsp;&nbsp;m_pGC ',CAPTION,'<strong>Brief description</strong><BR>');" onMouseOut="return nd();">m_pGC</a>(NULL), <a href="#" onMouseOver="link('_member','m_pImage3523944850',this); overLibDiagram();return overlib('<strong>Syntax</strong><BR>CPixmap *&nbsp;&nbsp;m_pImage ',CAPTION,'<strong>Brief description</strong><BR>');" onMouseOut="return nd();">m_pImage</a>(NULL), <a href="#" onMouseOver="link('_member','m_pButton3523944850',this); overLibDiagram();return overlib('<strong>Syntax</strong><BR>CButton *&nbsp;&nbsp;m_pButton ',CAPTION,'<strong>Brief description</strong><BR>');" onMouseOut="return nd();">m_pButton</a>(NULL), <a href="#" onMouseOver="link('_member','m_Text3523944850',this); overLibDiagram();return overlib('<strong>Syntax</strong><BR>::std::string&nbsp;&nbsp;m_Text ',CAPTION,'<strong>Brief description</strong><BR>');" onMouseOut="return nd();">m_Text</a>(MessageText), <a href="#" onMouseOver="link('_member','m_pTextColor3523944850',this); overLibDiagram();return overlib('<strong>Syntax</strong><BR>CColor *&nbsp;&nbsp;m_pTextColor ',CAPTION,'<strong>Brief description</strong><BR>');" onMouseOut="return nd();">m_pTextColor</a>(pTextColor), <a href="#" onMouseOver="link('_member','m_iTextOffset3523944850',this); overLibDiagram();return overlib('<strong>Syntax</strong><BR>unsigned int&nbsp;&nbsp;m_iTextOffset ',CAPTION,'<strong>Brief description</strong><BR>');" onMouseOut="return nd();">m_iTextOffset</a>(iHorizontalOffset), <a href="#" onMouseOver="link('_member','m_iHorizontalOffset3523944850',this); overLibDiagram();return overlib('<strong>Syntax</strong><BR>unsigned int&nbsp;&nbsp;m_iHorizontalOffset ',CAPTION,'<strong>Brief description</strong><BR>');" onMouseOut="return nd();">m_iHorizontalOffset</a>(iHorizontalOffset),
   <a href="#" onMouseOver="link('_member','m_iVerticalOffset3523944850',this); overLibDiagram();return overlib('<strong>Syntax</strong><BR>unsigned int&nbsp;&nbsp;m_iVerticalOffset ',CAPTION,'<strong>Brief description</strong><BR>');" onMouseOut="return nd();">m_iVerticalOffset</a>(iVerticalOffset) {
       // Create graphics context.
       m_pGC = new CGraphicsContext(m_pXServerConnection, this);
       // Set text and compute text rectangle.
       m_pGC-&gt;SetText(m_Text);
       m_Rectangle = m_pGC-&gt;ComputeTextRectangle();
       // Get the image and compute the image rectangle.
       try {
           m_pImage = new CPixmap(m_pXServerConnection, m_pScreen, ImagePath);
       } catch(...) {
           m_pImage = NULL;
       }
       unsigned int imageWidth = 0u;
       unsigned int imageHeight = 0u;
       if(NULL != m_pImage) {
           imageWidth = m_pImage-&gt;GetWidth();
           imageHeight = m_pImage-&gt;GetHeight();
       }
       // Create the button and get the button size.
       CUInt2dRectangle rect(0, 0, 1, 1);
       m_pButton = new CButton(m_pXServerConnection, m_pScreen, this, rect, pEventHandler, "OK", pBackgroundColor, pTextColor, m_iHorizontalOffset, m_iVerticalOffset);
       unsigned int buttonWidth = m_pButton-&gt;GetSize().GetX();
       unsigned int buttonHeight = m_pButton-&gt;GetSize().GetY();
       // Compute the new window rectangle and the new button rectangle.
       unsigned int screenWidth = static_cast&lt;unsigned int&gt;(m_pScreen-&gt;ScreenWidth());
       unsigned int screenHeight = static_cast&lt;unsigned int&gt;(m_pScreen-&gt;ScreenHeight());
       unsigned int rectangleWidth = 0;
       if(0u == imageWidth) {
           rectangleWidth = m_Rectangle.GetWidth() + 2 * m_iHorizontalOffset;
       } else {
           rectangleWidth = m_Rectangle.GetWidth() + imageWidth + 3 * m_iHorizontalOffset;
           m_iTextOffset = 2 * m_iHorizontalOffset + imageWidth;
       }
       unsigned int rectangleHeight = 2 * m_iVerticalOffset;
       if(m_Rectangle.GetHeight() &gt; imageHeight) {
           rectangleHeight += m_Rectangle.GetHeight();
       } else {
           rectangleHeight += imageHeight;
       }
       unsigned int buttonPosX = rectangleWidth / 2 - buttonWidth / 2;
       unsigned int buttonPosY = rectangleHeight + m_iVerticalOffset;
       rectangleHeight += 2 * m_iVerticalOffset + buttonHeight;
       unsigned int rectanglePosX = 0;
       unsigned int rectanglePosY = 0;
       if(rectangleWidth &lt; screenWidth) {
           rectanglePosX = static_cast&lt;unsigned int&gt;(static_cast&lt;double&gt;(screenWidth) * 0.5) - static_cast&lt;unsigned int&gt;(static_cast&lt;double&gt;(rectangleWidth) * 0.5);
       }
       if(rectangleHeight &lt; screenHeight) {
           rectanglePosY = static_cast&lt;unsigned int&gt;(static_cast&lt;double&gt;(screenHeight) * 0.5) - static_cast&lt;unsigned int&gt;(static_cast&lt;double&gt;(rectangleHeight) * 0.5);
       }
       m_Rectangle.Set(rectanglePosX, rectanglePosY, rectangleWidth, rectangleHeight);
       rect.Set(buttonPosX, buttonPosY, buttonWidth, buttonHeight);
       // Destroy button.
       delete m_pButton;
       // Destroy GC.
       delete m_pGC;
       // Destroy window.
       Destroy();
       // Create the new window.
       Create(pScreen, NULL, m_Rectangle, KeyPressMask | ExposureMask | ButtonPressMask | StructureNotifyMask, pEventHandler, WindowName, "MessageBox",
              IconPath, pBackgroundColor, 0, false, true);
              // Create new GC.
       m_pGC = new <a href="#" onMouseOver="link('_class','CGraphicsContext4032',this); overLibDiagram();return overlib('<strong>Public Member Functions</strong><BR><TABLE><TR><TD>CGraphicsContext</TD></TR><TR><TD>ComputeCharactersWidths</TD></TR><TR><TD>ComputeTextLineHeight</TD></TR><TR><TD>ComputeTextRectangle</TD></TR><TR><TD>DrawFilledRectangle</TD></TR><TR><TD>DrawLine</TD></TR><TR><TD>DrawPixmap</TD></TR><TR><TD>DrawRectangle</TD></TR><TR><TD>DrawText</TD></TR><TR><TD>SetBackgroundColor</TD></TR><TR><TD>SetForegroundColor</TD></TR><TR><TD>SetText</TD></TR><TR><TD>~CGraphicsContext</TD></TR></TABLE>',CAPTION,'<strong>Brief description</strong><BR>Class, which represents window graphics context.');" onMouseOut="return nd();">CGraphicsContext</a>(m_pXServerConnection, this);
       // Set text.
       m_pGC-&gt;SetText(m_Text);
       // Create button.
       m_pButton = new <a href="#" onMouseOver="link('_class','CButton4032',this); overLibDiagram();return overlib('<strong>Public Member Functions</strong><BR><TABLE><TR><TD>CButton</TD></TR><TR><TD>OnButtonPress</TD></TR><TR><TD>OnButtonRelease</TD></TR><TR><TD>OnClick</TD></TR><TR><TD>OnExpose</TD></TR><TR><TD>OnMouseEnter</TD></TR><TR><TD>OnMouseExit</TD></TR><TR><TD>~CButton</TD></TR></TABLE>',CAPTION,'<strong>Brief description</strong><BR>Button class.');" onMouseOut="return nd();">CButton</a>(m_pXServerConnection, m_pScreen, this, rect, pEventHandler, "OK", pBackgroundColor, pTextColor, m_iHorizontalOffset, m_iVerticalOffset);
   }
</pre><div class="contentAirBottom"></div>
<script type="text/javascript">
 Body5();
Statistics("","","","","");
 Body6();
SetPageTab('_member','_source');
</script>
